package com.jeecms.wicool.entity.orders;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.time.DateFormatUtils;

import com.jeecms.wicool.entity.orders.base.AbstractOrders;
import com.jeecms.wicool.entity.shops.Coupon;
import com.jeecms.wicool.entity.user.Address;

/**
 * AbstractWeixinMaterial entity provides the base persistence definition of the
 * WeixinMaterial entity. @author MyEclipse Persistence Tools
 */

public  class Orders extends AbstractOrders implements
		java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Address address;
	
	private String consigneeName;
	
	private String consigneeAddr;
	
	private long mobile;
	
	private Coupon coupon;
	
	private String typeName;

    private BigDecimal backPrice = new BigDecimal(0);
    
    private BigDecimal couponPrice;
    
    private String songhuoDate;
    
    private Set<OrderProductMapping> mappingSet = new HashSet<OrderProductMapping>();
    
    private BigDecimal cardCoinPrice;
    
    private Integer distAddrId;
    
    private Integer canUseTicket;
    
    private Integer bookOrderType;
    
    private Integer timeInterval;
    
    private Timestamp orderDate;
    
    private String distributionTime;
    
    private BigDecimal totalCalorie;
    
    private Integer grabFlag;
    
    private String grabFlagName;
    
    private int cancelAdultFlag;
    
    private String cancelAdultFlagName;
    
    
    private String sideFood;//配菜（二选一的）
    
    private Integer addrId;//收货地址ID
    
    private String tradeAreaName;//商圈
    
    private String officeBuildingName;//写字楼

    
    private String productCateName;//
    
    
    
	public String getProductCateName() {
		return productCateName;
	}

	public void setProductCateName(String productCateName) {
		this.productCateName = productCateName;
	}

	public String getTradeAreaName() {
		return tradeAreaName;
	}

	public void setTradeAreaName(String tradeAreaName) {
		this.tradeAreaName = tradeAreaName;
	}

	public String getOfficeBuildingName() {
		return officeBuildingName;
	}

	public void setOfficeBuildingName(String officeBuildingName) {
		this.officeBuildingName = officeBuildingName;
	}

	public Integer getAddrId() {
		return addrId;
	}

	public void setAddrId(Integer addrId) {
		this.addrId = addrId;
	}



	public long getMobile() {
		return mobile;
	}



	public void setMobile(long mobile) {
		this.mobile = mobile;
	}



	/**
	 * 
	 // Constructors
	 * 
	 * /** default constructor
	 */
	public Orders() {
	}

	

	public Orders(Address address, String consigneeName, String consigneeAddr,
			Coupon coupon, String typeName, BigDecimal backPrice,
			BigDecimal couponPrice, String songhuoDate,
			Set<OrderProductMapping> mappingSet, BigDecimal cardCoinPrice,
			Integer distAddrId, Integer canUseTicket, Integer bookOrderType,
			Integer timeInterval, Timestamp orderDate, String distributionTime,
			BigDecimal totalCalorie, Integer grabFlag) {
		super();
		this.address = address;
		this.consigneeName = consigneeName;
		this.consigneeAddr = consigneeAddr;
		this.coupon = coupon;
		this.typeName = typeName;
		this.backPrice = backPrice;
		this.couponPrice = couponPrice;
		this.songhuoDate = songhuoDate;
		this.mappingSet = mappingSet;
		this.cardCoinPrice = cardCoinPrice;
		this.distAddrId = distAddrId;
		this.canUseTicket = canUseTicket;
		this.bookOrderType = bookOrderType;
		this.timeInterval = timeInterval;
		this.orderDate = orderDate;
		this.distributionTime = distributionTime;
		this.totalCalorie = totalCalorie;
		this.grabFlag = grabFlag;
	}


    
	public int getCancelAdultFlag() {
		return cancelAdultFlag;
	}



	public void setCancelAdultFlag(int cancelAdultFlag) {
		this.cancelAdultFlag = cancelAdultFlag;
	}



	public String getCancelAdultFlagName() {
		return cancelAdultFlagName;
	}



	public void setCancelAdultFlagName(String cancelAdultFlagName) {
		this.cancelAdultFlagName = cancelAdultFlagName;
	}



	public String getGrabFlagName() {
		return grabFlagName;
	}



	public void setGrabFlagName(String grabFlagName) {
		this.grabFlagName = grabFlagName;
	}

	public BigDecimal getCardCoinPrice() {
		return cardCoinPrice;
	}



	public void setCardCoinPrice(BigDecimal cardCoinPrice) {
		this.cardCoinPrice = cardCoinPrice;
	}



	public Integer getDistAddrId() {
		return distAddrId;
	}



	public void setDistAddrId(Integer distAddrId) {
		this.distAddrId = distAddrId;
	}



	public Integer getCanUseTicket() {
		return canUseTicket;
	}



	public void setCanUseTicket(Integer canUseTicket) {
		this.canUseTicket = canUseTicket;
	}



	public Integer getBookOrderType() {
		return bookOrderType;
	}



	public void setBookOrderType(Integer bookOrderType) {
		this.bookOrderType = bookOrderType;
	}



	public Integer getTimeInterval() {
		return timeInterval;
	}



	public void setTimeInterval(Integer timeInterval) {
		this.timeInterval = timeInterval;
	}



	public Timestamp getOrderDate() {
		return orderDate;
	}



	public void setOrderDate(Timestamp orderDate) {
		this.orderDate = orderDate;
	}



	public String getDistributionTime() {
		return distributionTime;
	}



	public void setDistributionTime(String distributionTime) {
		this.distributionTime = distributionTime;
	}



	public BigDecimal getTotalCalorie() {
		return totalCalorie;
	}



	public void setTotalCalorie(BigDecimal totalCalorie) {
		this.totalCalorie = totalCalorie;
	}



	public Integer getGrabFlag() {
		return grabFlag;
	}



	public void setGrabFlag(Integer grabFlag) {
		this.grabFlag = grabFlag;
	}



	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public String getConsigneeName() {
		return consigneeName;
	}

	public void setConsigneeName(String consigneeName) {
		this.consigneeName = consigneeName;
	}

	public String getConsigneeAddr() {
		return consigneeAddr;
	}

	public void setConsigneeAddr(String consigneeAddr) {
		this.consigneeAddr = consigneeAddr;
	}

	public Coupon getCoupon() {
		return coupon;
	}

	public void setCoupon(Coupon coupon) {
		this.coupon = coupon;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

    public BigDecimal getBackPrice() {
        return backPrice;
    }

    public void setBackPrice(BigDecimal backPrice) {
        this.backPrice = backPrice;
    }

	public BigDecimal getCouponPrice() {
		return couponPrice;
	}

	public void setCouponPrice(BigDecimal couponPrice) {
		this.couponPrice = couponPrice;
	}

	public String getSonghuoDate() {
		Date date = new Date(this.getCreateTime().getTime());
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		int hour = cal.get(Calendar.HOUR_OF_DAY);
		if(hour == 23){
			cal.add(Calendar.DATE, 2);
		}else{
			cal.add(Calendar.DATE, 1);
		}
		return DateFormatUtils.format(cal.getTime(), "yyyy-MM-dd");
	}

	public void setSonghuoDate(String songhuoDate) {
		this.songhuoDate = songhuoDate;
	}

	public Set<OrderProductMapping> getMappingSet() {
		return mappingSet;
	}

	public void setMappingSet(Set<OrderProductMapping> mappingSet) {
		this.mappingSet = mappingSet;
	}



	public String getSideFood() {
		return sideFood == null ? "" : sideFood;
	}



	public void setSideFood(String sideFood) {
		this.sideFood = sideFood;
	}
	
}